rm(list= ls())

library(tidyverse)
library(sf)

## Load Data on Synagogues 

syn <- read.csv('data/kristallnacht_syns_for_compiling.csv') %>%
  st_as_sf(coords = c('lon', 'lat'), crs = 4326) 

## Load 2020 Shapefile 

shp <- read_sf('data/shape_33/German_Empire_1933_v.1.0.shp') %>% 
  st_transform(shp, crs = 4326) 

## FIGURE 1

p1 <- ggplot() + 
  geom_sf(data = shp, lwd = .3, fill = 'white') +
  geom_sf(data = syn, size = .6, fill = "black") + 
  theme(panel.grid.major = element_line(colour = 'transparent'),
        axis.title.x = element_blank(), 
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank(),
        axis.title.y = element_blank(), 
        axis.text.y = element_blank(),
        axis.ticks.y = element_blank(),
        panel.background = element_blank(),
        panel.border = element_blank(),
        panel.grid.minor = element_blank(),
        plot.background = element_blank()) +
  labs(title = '') 


p1

## FIGURE A1

p2 <- ggplot() + 
  geom_sf(data = shp, lwd = .3, fill = 'white') +
  geom_sf(data = syn, size = .8, shape = 23, aes(fill = as.factor(syn_attack_final))) + 
  theme(panel.grid.major = element_line(colour = 'transparent'),
        axis.title.x = element_blank(), 
        axis.text.x = element_blank(),
        axis.ticks.x = element_blank(),
        axis.title.y = element_blank(), 
        axis.text.y = element_blank(),
        axis.ticks.y = element_blank(),
        panel.background = element_blank(),
        panel.border = element_blank(),
        panel.grid.minor = element_blank(),
        plot.background = element_blank()) +
  labs(title = '') +
  labs(fill = '') + 
  scale_fill_manual(values = c('black','orange'), 
                    labels = c('Synagogue: not attacked',
                               'Synagogue: attacked')) + 
  theme(legend.position = 'bottom')


p2


